package cqrtplm.listener;

import cn.hutool.extra.spring.SpringUtil;
import com.hustcad.plm.pdm.workflow.annotion.CustomListener;
import cqrtplm.service.DocFolderOperationService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.ExecutionListener;


@Slf4j
@CustomListener(category = "润通", description = "PCR交付物解密移库")
public class PCRDeliverablesMovedWarehouseListener implements ExecutionListener {



    @Override
    public void notify(DelegateExecution execution) {
        String workFlowContainerId = String.valueOf(execution.getVariable("workFlowContainerId"));
//        String processInstanceBusinessKey = execution.getProcessInstanceBusinessKey();
//        System.out.println(processInstanceBusinessKey);
        DocFolderOperationService docFolderOperationService = SpringUtil.getBean(DocFolderOperationService.class);
        try {
            docFolderOperationService.deliverablesMovedWarehouse(workFlowContainerId);

        }catch (Exception e){
            throw new RuntimeException(e);
        }

    }
}
